#include <bits/stdc++.h>
using namespace std;
const int N = 28;

struct Node
{
    int num, t;
    string word;
};
int n;
vector<Node> edges[N];
string ans;
bool visit[1001];
int in[N], out[N], fa[N];
bool exist[N];
void dfs(int s, string cur, int sum)
{
    if (sum == n)
    {
        if (ans.empty())
            ans = cur;
        else if (cur.compare(ans) < 0)
            ans = cur;
        return;
    }
    int num, tar;
    for (auto u : edges[s])
    {
        num = u.num;
        if (!visit[num])
        {
            visit[num] = true;
            if (sum == 0)
                dfs(u.t, u.word, sum + 1);
            else
                dfs(u.t, cur + "." + u.word, sum + 1);
            visit[num] = false;
        }
    }
}
int find(int x)
{
    if (x != fa[x])
        fa[x] = find(fa[fa[x]]);
    return fa[x];
}
int main()
{
    int setnum = 0;
    cin >> n;
    string str;
    int st, en;
    memset(exist, false, sizeof(exist));
    memset(in, 0, sizeof(in));
    memset(out, 0, sizeof(out));
    for (int i = 0; i < n; i++)
    {
        cin >> str;
        st = str[0] - 'a';
        out[st]++;
        en = str[str.length() - 1] - 'a';
        in[en]++;
        if (!exist[st])
        {
            setnum++;
            fa[st] = st;
            exist[st] = true;
        }
        if (!exist[en])
        {
            setnum++;
            fa[en] = en;
            exist[en] = true;
        }
        if (en != st)
        {
            int enf = find(en);
            int stf = find(st);
            if (enf != stf)
            {
                setnum--;
                fa[stf] = fa[enf];
            }
        }
        Node node;
        node.t = en;
        node.num = i;
        node.word = str;
        edges[st].emplace_back(node);
    }
    if (setnum > 1)
    {
        cout << "***";
        return 0;
    }
    // cout << "1111" << endl;
    int s = -1, t = -1;
    for (int i = 0; i < 26; i++)
    {
        if (out[i] - in[i] == 1)
        {
            if (s == -1)
                s = i;
            else
            {
                cout << "***";
                return 0;
            }
        }
        if (in[i] - out[i] == 1)
        {
            if (t == -1)
                t = i;
            else
            {
                cout << "***";
                return 0;
            }
        }
    }
    if (s == -1)
    {
        for (int i = 0; i < 26; i++)
        {
            if (exist[i])
            {
                s = i;
                break;
            }
        }
    }
    dfs(s, "", 0);
    cout << ans;
    return 0;
}